/*
 * Exploder
 * 
 * Tero Pyylampi (218437), Jussi Tuurinkoski (211594)
 *
 * Abstract base class for all the different bombs in the game
 */

#include "GameBomb.h"

// default constructor
GameBomb::GameBomb( b2World *world, cocos2d::CCLayer *layer, GameCamera *camera ) 
	: GamePhysicObject( world ), mGameLayer( layer ), mGameCamera( camera ) {
	// init bomb
	// TODO
}

// default destructor
GameBomb::~GameBomb() {
	// TODO
}

// update function
void GameBomb::update( cocos2d::ccTime dt ) {
	GamePhysicObject::update( dt );
}

// set new color for object sprites
void GameBomb::setObjectColor( cocos2d::ccColor3B c ) {
	for( unsigned int i = 0; i < mSprites.size(); ++i ) {
		mSprites.at( i )->setColor( c );
	}
}

// grab bomb
void GameBomb::grabBomb() {
	// TODO
}

// release bomb
void GameBomb::releaseBomb() {
	// TODO
}

// detonate bomb
void GameBomb::detonate() {}

// get absolute screen position of the sprite
cocos2d::CCPoint GameBomb::getObjectScreenPosition() {
	return mGameLayer->convertToWorldSpace( mSprites.at( 0 )->getPosition() );
}
